﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:visualizationToolkit="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit" 
	xmlns:datavis="clr-namespace:System.Windows.Controls.DataVisualization"
	xmlns:System_Windows_Controls_DataVisualization_Charting_Primitives="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit"
	xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:Faust_Andrew_MTG="clr-namespace:Faust.Andrew.MTG;assembly=CardLib" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
    xmlns:Faust_Adnrew_MTG_Utilities="clr-namespace:Faust.Andrew.MTG.Utilities;assembly=Faust.Andrew.MTG.Utilities"    
    >
	<!-- Resource dictionary entries should be defined here. -->
	<Faust_Adnrew_MTG_Utilities:RarityToBrush x:Key="RarityToBrush"/>
	<Faust_Adnrew_MTG_Utilities:ManaColorToBrush x:Key="ManaColorToBrush"/>
	<Faust_Adnrew_MTG_Utilities:ManaColorToBrushVertical x:Key="ManaColorToBrushVertical"/>
	<Faust_Adnrew_MTG_Utilities:ImageSourceFromImage x:Key="ImageSourceFromImage"/>
	<Faust_Adnrew_MTG_Utilities:IntToStringConverter x:Key="IntToStringConverter"/>
	
	<DataTemplate x:Key="CardItemTemplate">
		<StackPanel x:Name="LayoutRoot" ToolTip="{Binding CardText, Mode=OneWay}">
			<StackPanel.LayoutTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</StackPanel.LayoutTransform>
			<Border x:Name="border" BorderThickness="10" HorizontalAlignment="Left" VerticalAlignment="Top" Padding="10" CornerRadius="5" Background="{Binding Color, Converter={StaticResource ManaColorToBrushVertical}, Mode=OneWay}" BorderBrush="{Binding Rarity, Converter={StaticResource RarityToBrush}, Mode=OneWay}">
				<StackPanel Margin="0">
					<Image Height="310" Width="223" Source="{Binding ImageSource, Mode=OneWay}"/>
					<Grid Margin="0,5,0,0" Background="#FF6E6E6E">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto"/>
							<ColumnDefinition Width="0.5*"/>
							<ColumnDefinition Width="Auto"/>
							<ColumnDefinition Width="0.5*"/>
							<ColumnDefinition Width="Auto"/>
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>					
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>
						<Label x:Name="OwnedLabel" Margin="0" Content="Owned:" Foreground="White"/>
						<Label x:Name="InUseLabel" Margin="0" VerticalAlignment="Top" Grid.Column="2" Content="In Use:" Foreground="White"/>
						<Label x:Name="InUseCount" HorizontalAlignment="Left" Margin="0" VerticalAlignment="Bottom" Grid.Column="3" Foreground="White" Content="{Binding InUse}"/>
						<TextBox x:Name="txtOwned" Margin="0,2" Text="{Binding Quantity, Converter={StaticResource IntToStringConverter}, Mode=TwoWay}" TextWrapping="Wrap" d:LayoutOverrides="Width, Height" Grid.Column="1" Background="DarkGray" VerticalAlignment="Center"/>
						<ToggleButton x:Name="toggleButton" Margin="0" Style="{DynamicResource BiggifyButtonTemplate}" ContentTemplate="{DynamicResource BiggifyButtonContentTemplate}" Grid.Column="4"/>
					</Grid>
				</StackPanel>
			</Border>
		</StackPanel>
		<DataTemplate.Triggers>
			<Trigger Property="IsChecked" Value="True" SourceName="toggleButton">
				<Setter Property="LayoutTransform" TargetName="LayoutRoot">
					<Setter.Value>
						<TransformGroup>
							<ScaleTransform ScaleX="1.0" ScaleY="1.0"/>
							<SkewTransform/>
							<RotateTransform/>
							<TranslateTransform/>
						</TransformGroup>
					</Setter.Value>
				</Setter>
			</Trigger>
			<Trigger Property="IsChecked" SourceName="toggleButton" Value="True">
				<Setter Property="LayoutTransform" TargetName="LayoutRoot">
					<Setter.Value>
						<TransformGroup>
							<ScaleTransform ScaleX="1.5" ScaleY="1.5"/>
							<SkewTransform/>
							<RotateTransform/>
							<TranslateTransform/>
						</TransformGroup>
					</Setter.Value>
				</Setter>
			</Trigger>
		</DataTemplate.Triggers>
	</DataTemplate>
	<ItemsPanelTemplate x:Key="CardLayoutTemplate">
		<WrapPanel IsItemsHost="True"/>
	</ItemsPanelTemplate>
	<Style x:Key="CardItemContainerTemplate" TargetType="{x:Type ListBoxItem}">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
		<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
		<Setter Property="Padding" Value="5"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ListBoxItem}">
					<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Margin="3" RenderTransformOrigin="0.5,0.5">
						<Border.LayoutTransform>
							<TransformGroup>
								<ScaleTransform/>
								<SkewTransform/>
								<RotateTransform/>
								<TranslateTransform/>
							</TransformGroup>
						</Border.LayoutTransform>
						<Border.RenderTransform>
							<TransformGroup>
								<ScaleTransform/>
								<SkewTransform/>
								<RotateTransform/>
								<TranslateTransform/>
							</TransformGroup>
						</Border.RenderTransform>
						<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsSelected" Value="true">
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>							
						</Trigger>
						<Trigger Property="Selector.IsSelected" Value="False">							
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="true"/>
								<Condition Property="Selector.IsSelectionActive" Value="false"/>
							</MultiTrigger.Conditions>
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
						</MultiTrigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<SolidColorBrush x:Key="DefaultWindowBackground" Color="#FF616161"/>
	<SolidColorBrush x:Key="ControlBoxBrush" Color="#FFC6C5C5"/>
	<DataTemplate x:Key="DeckCardListBoxItem" >
		<Border x:Name="border" BorderBrush="Black" BorderThickness="1" Padding="2" HorizontalAlignment="Left" VerticalAlignment="Top">
			<Border.LayoutTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Border.LayoutTransform>
			<StackPanel Height="Auto" Background="#FF555555" HorizontalAlignment="Left" VerticalAlignment="Top">
				<Image x:Name="image" Width="223" Height="310" Source="{Binding Card.ImageSource, Mode=OneWay}"/>
				<Grid Height="Auto">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="0.33*"/>
						<ColumnDefinition Width="0.33*"/>
						<ColumnDefinition Width="0.33*"/>
					</Grid.ColumnDefinitions>
					<StackPanel Margin="0" Orientation="Horizontal">
						<Label Content="Owned:" Margin="0,0,2,0" Foreground="White"/>
						<Label Content="{Binding Card.Quantity}" Foreground="White"/>
					</StackPanel>
					<ToggleButton x:Name="toggleButton" HorizontalAlignment="Right" Margin="0" Style="{DynamicResource BiggifyButtonTemplate}" VerticalAlignment="Center" Content="" ContentTemplate="{DynamicResource BiggifyButtonContentTemplate}" Grid.ColumnSpan="1" Grid.Column="2" Width="26" Height="26">
						<ToggleButton.LayoutTransform>
							<TransformGroup>
								<ScaleTransform/>
								<SkewTransform/>
								<RotateTransform/>
								<TranslateTransform/>
							</TransformGroup>
						</ToggleButton.LayoutTransform>
					</ToggleButton>
					<TextBox Text="{Binding Quantity, Converter={StaticResource IntToStringConverter}, Mode=TwoWay}" TextWrapping="Wrap" HorizontalAlignment="Center" Background="#2A302727" Foreground="#FFE2E2E2" Style="{DynamicResource DeckItemQuantityTextBoxTemplate}" Width="40" HorizontalContentAlignment="Center" Margin="0" VerticalAlignment="Center" Grid.Column="1"/>
				</Grid>
			</StackPanel>
		</Border>
		<DataTemplate.Triggers>
			<Trigger Property="IsChecked" Value="False" SourceName="toggleButton">
				<Setter Property="LayoutTransform" TargetName="border">
					<Setter.Value>
						<TransformGroup>
							<ScaleTransform ScaleX="1.0" ScaleY="1.0"/>
							<SkewTransform/>
							<RotateTransform/>
							<TranslateTransform/>
						</TransformGroup>
					</Setter.Value>
				</Setter>
			</Trigger>
			<Trigger Property="IsChecked" Value="True" SourceName="toggleButton">
				<Setter Property="LayoutTransform" TargetName="border">
					<Setter.Value>
						<TransformGroup>
							<ScaleTransform ScaleX="1.5" ScaleY="1.5"/>
							<SkewTransform/>
							<RotateTransform/>
							<TranslateTransform/>
						</TransformGroup>
					</Setter.Value>
				</Setter>
			</Trigger>
		</DataTemplate.Triggers>
	</DataTemplate>
	<Style x:Key="DeckCardItemLayoutTemplate" TargetType="{x:Type ListBoxItem}">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
		<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
		<Setter Property="Padding" Value="2,0,0,0"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ListBoxItem}">
					<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Margin="2">
						<Border.LayoutTransform>
							<TransformGroup>
								<ScaleTransform/>
								<SkewTransform/>
								<RotateTransform/>
								<TranslateTransform/>
							</TransformGroup>
						</Border.LayoutTransform>
						<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
					</Border>
					<ControlTemplate.Triggers>						
						<Trigger Property="IsSelected" Value="true">
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="true"/>
								<Condition Property="Selector.IsSelectionActive" Value="false"/>
							</MultiTrigger.Conditions>
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
						</MultiTrigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="DeckItemQuantityTextBoxTemplate" BasedOn="{x:Null}" TargetType="{x:Type TextBox}">
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
		<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Padding" Value="1"/>
		<Setter Property="AllowDrop" Value="true"/>
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TextBox}">
					<Microsoft_Windows_Themes:ListBoxChrome x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" RenderFocused="{TemplateBinding IsKeyboardFocusWithin}" RenderMouseOver="{TemplateBinding IsMouseOver}">
						<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
					</Microsoft_Windows_Themes:ListBoxChrome>
					<ControlTemplate.Triggers>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<DataTemplate x:Key="BiggifyButtonContentTemplate">
		<Grid>
			<Ellipse Stroke="White"/>
			<Path Stretch="Fill" Stroke="White" Margin="9.917,0.458,9.083,0" VerticalAlignment="Top" Height="1" Data="M9.9166667,0.45833333"/>
			<Path Stretch="Fill" Stroke="White" Margin="9.533,0.416,9.425,0.208" Data="M9.4903801,0.24978312 L9.5323805,18.625116"/>
			<Path Stretch="Fill" Stroke="White" Margin="0.459,9.417,-0.024,9.59" Data="M0.45833333,9.4169997 L19.083333,9.4169997"/>
		</Grid>
	</DataTemplate>
	<Style x:Key="BiggifyButtonTemplate" TargetType="{x:Type ToggleButton}">
		<Style.Triggers>
			<Trigger Property="IsChecked" Value="False">
				<Setter Property="ToolTip" Value="Biggify"/>
			</Trigger>
			<Trigger Property="IsChecked" Value="True">
				<Setter Property="ToolTip" Value="De-Biggify"/>
			</Trigger>
		</Style.Triggers>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
		<Setter Property="HorizontalContentAlignment" Value="Center"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="Padding" Value="1"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" SnapsToDevicePixels="true" RenderDefaulted="{TemplateBinding Button.IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}">
						<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
					</Microsoft_Windows_Themes:ButtonChrome>
					<ControlTemplate.Triggers>
						<Trigger Property="IsKeyboardFocused" Value="true">
							<Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
						</Trigger>
						<Trigger Property="IsChecked" Value="true">
							<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="#ADADAD"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
			<Style x:Key="DeckStatPieTemplate" TargetType="{x:Type chartingToolkit:Chart}">
			<Setter Property="BorderBrush" Value="Black"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="IsTabStop" Value="False"/>
			<Setter Property="SnapsToDevicePixels" Value="True"/>
			<Setter Property="StylePalette">
				<Setter.Value>
					<visualizationToolkit:StylePalette>																	
						<Style TargetType="{x:Type Control}">
							<Setter Property="Background">
								<Setter.Value>
									<RadialGradientBrush>
										<RadialGradientBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
												<TranslateTransform X="-0.425" Y="-0.486"/>
											</TransformGroup>
										</RadialGradientBrush.RelativeTransform>
										<GradientStop Color="#FFB9D6F7"/>
										<GradientStop Color="#FF284B70" Offset="1"/>
									</RadialGradientBrush>
								</Setter.Value>
							</Setter>
						</Style>
						<Style TargetType="{x:Type Control}">
							<Setter Property="Background">
								<Setter.Value>
									<RadialGradientBrush>
										<RadialGradientBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
												<TranslateTransform X="-0.425" Y="-0.486"/>
											</TransformGroup>
										</RadialGradientBrush.RelativeTransform>
										<GradientStop Color="#FFFBB7B5"/>
										<GradientStop Color="#FF702828" Offset="1"/>
									</RadialGradientBrush>
								</Setter.Value>
							</Setter>
						</Style>
						<Style TargetType="{x:Type Control}">
							<Setter Property="Background">
								<Setter.Value>
									<RadialGradientBrush>
										<RadialGradientBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
												<TranslateTransform X="-0.425" Y="-0.486"/>
											</TransformGroup>
										</RadialGradientBrush.RelativeTransform>
										<GradientStop Color="#FFB8C0AC"/>
										<GradientStop Color="#FF5F7143" Offset="1"/>
									</RadialGradientBrush>
								</Setter.Value>
							</Setter>
						</Style>
						<Style TargetType="{x:Type Control}">
							<Setter Property="Background">
								<Setter.Value>
									<RadialGradientBrush>
										<RadialGradientBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
												<TranslateTransform X="-0.425" Y="-0.486"/>
											</TransformGroup>
										</RadialGradientBrush.RelativeTransform>
										<GradientStop Color="#FFFDE79C"/>
										<GradientStop Color="#FFF6BC0C" Offset="1"/>
									</RadialGradientBrush>
								</Setter.Value>
							</Setter>
						</Style>
						<Style TargetType="{x:Type Control}">
							<Setter Property="Background">
								<Setter.Value>
									<RadialGradientBrush>
										<RadialGradientBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
												<TranslateTransform X="-0.425" Y="-0.486"/>
											</TransformGroup>
										</RadialGradientBrush.RelativeTransform>
										<GradientStop Color="#FFA9A3BD"/>
										<GradientStop Color="#FF382C6C" Offset="1"/>
									</RadialGradientBrush>
								</Setter.Value>
							</Setter>
						</Style>
						<Style TargetType="{x:Type Control}">
							<Setter Property="Background">
								<Setter.Value>
									<RadialGradientBrush>
										<RadialGradientBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
												<TranslateTransform X="-0.425" Y="-0.486"/>
											</TransformGroup>
										</RadialGradientBrush.RelativeTransform>
										<GradientStop Color="#FFB1A1B1"/>
										<GradientStop Color="#FF50224F" Offset="1"/>
									</RadialGradientBrush>
								</Setter.Value>
							</Setter>
						</Style>
						<Style TargetType="{x:Type Control}">
							<Setter Property="Background">
								<Setter.Value>
									<RadialGradientBrush>
										<RadialGradientBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
												<TranslateTransform X="-0.425" Y="-0.486"/>
											</TransformGroup>
										</RadialGradientBrush.RelativeTransform>
										<GradientStop Color="#FF9DC2B3"/>
										<GradientStop Color="#FF1D7554" Offset="1"/>
									</RadialGradientBrush>
								</Setter.Value>
							</Setter>
						</Style>
						<Style TargetType="{x:Type Control}">
							<Setter Property="Background">
								<Setter.Value>
									<RadialGradientBrush>
										<RadialGradientBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
												<TranslateTransform X="-0.425" Y="-0.486"/>
											</TransformGroup>
										</RadialGradientBrush.RelativeTransform>
										<GradientStop Color="#FFB5B5B5"/>
										<GradientStop Color="#FF4C4C4C" Offset="1"/>
									</RadialGradientBrush>
								</Setter.Value>
							</Setter>
						</Style>
						<Style TargetType="{x:Type Control}">
							<Setter Property="Background">
								<Setter.Value>
									<RadialGradientBrush>
										<RadialGradientBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
												<TranslateTransform X="-0.425" Y="-0.486"/>
											</TransformGroup>
										</RadialGradientBrush.RelativeTransform>
										<GradientStop Color="#FF98C1DC"/>
										<GradientStop Color="#FF0271AE" Offset="1"/>
									</RadialGradientBrush>
								</Setter.Value>
							</Setter>
						</Style>
						<Style TargetType="{x:Type Control}">
							<Setter Property="Background">
								<Setter.Value>
									<RadialGradientBrush>
										<RadialGradientBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
												<TranslateTransform X="-0.425" Y="-0.486"/>
											</TransformGroup>
										</RadialGradientBrush.RelativeTransform>
										<GradientStop Color="#FFC1C0AE"/>
										<GradientStop Color="#FF706E41" Offset="1"/>
									</RadialGradientBrush>
								</Setter.Value>
							</Setter>
						</Style>
						<Style TargetType="{x:Type Control}">
							<Setter Property="Background">
								<Setter.Value>
									<RadialGradientBrush>
										<RadialGradientBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
												<TranslateTransform X="-0.425" Y="-0.486"/>
											</TransformGroup>
										</RadialGradientBrush.RelativeTransform>
										<GradientStop Color="#FFADBDC0"/>
										<GradientStop Color="#FF446A73" Offset="1"/>
									</RadialGradientBrush>
								</Setter.Value>
							</Setter>
						</Style>
						<Style TargetType="{x:Type Control}">
							<Setter Property="Background">
								<Setter.Value>
									<RadialGradientBrush>
										<RadialGradientBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
												<TranslateTransform X="-0.425" Y="-0.486"/>
											</TransformGroup>
										</RadialGradientBrush.RelativeTransform>
										<GradientStop Color="#FF2F8CE2"/>
										<GradientStop Color="#FF0C3E69" Offset="1"/>
									</RadialGradientBrush>
								</Setter.Value>
							</Setter>
						</Style>
						<Style TargetType="{x:Type Control}">
							<Setter Property="Background">
								<Setter.Value>
									<RadialGradientBrush>
										<RadialGradientBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
												<TranslateTransform X="-0.425" Y="-0.486"/>
											</TransformGroup>
										</RadialGradientBrush.RelativeTransform>
										<GradientStop Color="Gainsboro"/>
										<GradientStop Color="#FF757575" Offset="1"/>
									</RadialGradientBrush>
								</Setter.Value>
							</Setter>
						</Style>
						<Style TargetType="{x:Type Control}">
							<Setter Property="Background">
								<Setter.Value>
									<RadialGradientBrush>
										<RadialGradientBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
												<TranslateTransform X="-0.425" Y="-0.486"/>
											</TransformGroup>
										</RadialGradientBrush.RelativeTransform>
										<GradientStop Color="#FFF4F4F4"/>
										<GradientStop Color="#FFB7B7B7" Offset="1"/>
									</RadialGradientBrush>
								</Setter.Value>
							</Setter>
						</Style>
						<Style TargetType="{x:Type Control}">
							<Setter Property="Background">
								<Setter.Value>
									<RadialGradientBrush>
										<RadialGradientBrush.RelativeTransform>
											<TransformGroup>
												<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
												<TranslateTransform X="-0.425" Y="-0.486"/>
											</TransformGroup>
										</RadialGradientBrush.RelativeTransform>
										<GradientStop Color="#FFF4F4F4"/>
										<GradientStop Color="#FFA3A3A3" Offset="1"/>
									</RadialGradientBrush>
								</Setter.Value>
							</Setter>
						</Style>						
					</visualizationToolkit:StylePalette>
				</Setter.Value>
			</Setter>
			<Setter Property="TitleStyle">
				<Setter.Value>
					<Style TargetType="{x:Type visualizationToolkit:Title}">
						<Setter Property="FontSize" Value="16"/>
						<Setter Property="HorizontalAlignment" Value="Center"/>
						<Setter Property="Margin" Value="0,10"/>
					</Style>
				</Setter.Value>
			</Setter>
			<Setter Property="LegendStyle">
				<Setter.Value>
					<Style TargetType="{x:Type visualizationToolkit:Legend}">
						<Setter Property="Margin" Value="15,0"/>
						<Setter Property="VerticalAlignment" Value="Center"/>
						<Setter Property="BorderBrush" Value="#FFDBDBDB"/>
						<Setter Property="Background">
							<Setter.Value>
								<LinearGradientBrush EndPoint="0.442,0.005" StartPoint="0.558,0.995">
									<GradientStop Color="#FFDBDBDB"/>
									<GradientStop Color="White" Offset="1"/>
								</LinearGradientBrush>
							</Setter.Value>
						</Setter>
					</Style>
				</Setter.Value>
			</Setter>
			<Setter Property="ChartAreaStyle">
				<Setter.Value>
					<Style TargetType="{x:Type Panel}">
						<Setter Property="MinWidth" Value="100"/>
						<Setter Property="MinHeight" Value="75"/>
					</Style>
				</Setter.Value>
			</Setter>
			<Setter Property="PlotAreaStyle">
				<Setter.Value>
					<Style TargetType="{x:Type Grid}">
						<Setter Property="Background">
							<Setter.Value>
								<LinearGradientBrush EndPoint="0.457,0.296" StartPoint="0.459,1.296">
									<GradientStop Color="#FFCBCBCB"/>
									<GradientStop Color="White" Offset="1"/>
								</LinearGradientBrush>
							</Setter.Value>
						</Setter>
					</Style>
				</Setter.Value>
			</Setter>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type chartingToolkit:Chart}">
						<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="10">
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="*"/>
								</Grid.RowDefinitions>
								<visualizationToolkit:Title Style="{TemplateBinding TitleStyle}" Content="{TemplateBinding Title}" Margin="0,10,0,5"/>
								<Grid Margin="0" Grid.Row="1">
									<Grid.RowDefinitions>
										<RowDefinition Height="*"/>
										<RowDefinition Height="Auto"/>
									</Grid.RowDefinitions>
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="*"/>
									</Grid.ColumnDefinitions>
									<System_Windows_Controls_DataVisualization_Charting_Primitives:EdgePanel x:Name="ChartArea" Style="{TemplateBinding ChartAreaStyle}" Margin="0,0,0,5">
										<Grid Style="{TemplateBinding PlotAreaStyle}" Panel.ZIndex="-1"/>
										<Border Panel.ZIndex="10" BorderBrush="#FF919191" BorderThickness="1"/>
									</System_Windows_Controls_DataVisualization_Charting_Primitives:EdgePanel>
									<visualizationToolkit:Legend x:Name="Legend" Style="{TemplateBinding LegendStyle}" Grid.Column="0" Title="{TemplateBinding LegendTitle}" Grid.Row="1" Margin="0" VerticalAlignment="Stretch"/>
								</Grid>
							</Grid>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<ControlTemplate x:Key="DeckStatColorPieDataPoint" TargetType="{x:Type chartingToolkit:PieDataPoint}">
			<Grid x:Name="Root" Opacity="0">
				<VisualStateManager.VisualStateGroups>
					<VisualStateGroup x:Name="CommonStates">
						<VisualStateGroup.Transitions>
							<VisualTransition GeneratedDuration="00:00:00.1000000"/>
						</VisualStateGroup.Transitions>
						<VisualState x:Name="Normal"/>
						<VisualState x:Name="MouseOver">
							<Storyboard>
								<DoubleAnimation Duration="00:00:00" Storyboard.TargetName="MouseOverHighlight" Storyboard.TargetProperty="Opacity" To="0.6"/>
							</Storyboard>
						</VisualState>
					</VisualStateGroup>
					<VisualStateGroup x:Name="SelectionStates">
						<VisualStateGroup.Transitions>
							<VisualTransition GeneratedDuration="00:00:00.1000000"/>
						</VisualStateGroup.Transitions>
						<VisualState x:Name="Unselected"/>
						<VisualState x:Name="Selected">
							<Storyboard>
								<DoubleAnimation Duration="00:00:00" Storyboard.TargetName="SelectionHighlight" Storyboard.TargetProperty="Opacity" To="0.6"/>
							</Storyboard>
						</VisualState>
					</VisualStateGroup>
					<VisualStateGroup x:Name="RevealStates">
						<VisualStateGroup.Transitions>
							<VisualTransition GeneratedDuration="00:00:00.5000000"/>
						</VisualStateGroup.Transitions>
						<VisualState x:Name="Shown">
							<Storyboard>
								<DoubleAnimation Duration="00:00:00" Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="1"/>
							</Storyboard>
						</VisualState>
						<VisualState x:Name="Hidden">
							<Storyboard>
								<DoubleAnimation Duration="00:00:00" Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="0"/>
							</Storyboard>
						</VisualState>
					</VisualStateGroup>
				</VisualStateManager.VisualStateGroups>
				<Path x:Name="Slice" Fill="{TemplateBinding IndependentValue, Converter={StaticResource ManaColorToBrushVertical}}" Stroke="{TemplateBinding BorderBrush}" StrokeMiterLimit="1" Data="{TemplateBinding Geometry}">
					<Path.ToolTip>
						<StackPanel>
							<!--<ContentControl Content="{TemplateBinding IndependentValue}"/>-->
							<ContentControl Content="{TemplateBinding DependentValue}"/>
							<ContentControl Content="{TemplateBinding FormattedRatio}"/>
						</StackPanel>
					</Path.ToolTip>
				</Path>
				<Path x:Name="SelectionHighlight" Fill="Red" StrokeMiterLimit="1" IsHitTestVisible="False" Opacity="0" Data="{TemplateBinding GeometrySelection}"/>
				<Path x:Name="MouseOverHighlight" Fill="White" StrokeMiterLimit="1" IsHitTestVisible="False" Opacity="0" Data="{TemplateBinding GeometryHighlight}"/>
			</Grid>
		</ControlTemplate>
		<Style x:Key="ColorPieChartTemplate" TargetType="{x:Type chartingToolkit:Chart}">
			<Setter Property="BorderBrush" Value="Black"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="IsTabStop" Value="False"/>
			<Setter Property="SnapsToDevicePixels" Value="True"/>
			<Setter Property="StylePalette">
				<Setter.Value>
					<visualizationToolkit:StylePalette>
						<Style TargetType="{x:Type chartingToolkit:PieDataPoint}">
							<Setter Property="Template" Value="{StaticResource DeckStatColorPieDataPoint}" />
						</Style>
				</visualizationToolkit:StylePalette>
				</Setter.Value>
			</Setter>				
			<Setter Property="TitleStyle">
				<Setter.Value>
					<Style TargetType="{x:Type visualizationToolkit:Title}">
						<Setter Property="FontSize" Value="16"/>
						<Setter Property="HorizontalAlignment" Value="Center"/>
						<Setter Property="Margin" Value="0,10"/>
					</Style>
				</Setter.Value>
			</Setter>
			<Setter Property="LegendStyle">
				<Setter.Value>
					<Style TargetType="{x:Type visualizationToolkit:Legend}">
						<Setter Property="Margin" Value="15,0"/>
						<Setter Property="VerticalAlignment" Value="Center"/>
						<Setter Property="BorderBrush" Value="#FFDBDBDB"/>
						<Setter Property="Background">
							<Setter.Value>
								<LinearGradientBrush EndPoint="0.442,0.005" StartPoint="0.558,0.995">
									<GradientStop Color="#FFDBDBDB"/>
									<GradientStop Color="White" Offset="1"/>
								</LinearGradientBrush>
							</Setter.Value>
						</Setter>
					</Style>
				</Setter.Value>
			</Setter>
			<Setter Property="ChartAreaStyle">
				<Setter.Value>
					<Style TargetType="{x:Type Panel}">
						<Setter Property="MinWidth" Value="100"/>
						<Setter Property="MinHeight" Value="75"/>
					</Style>
				</Setter.Value>
			</Setter>
			<Setter Property="PlotAreaStyle">
				<Setter.Value>
					<Style TargetType="{x:Type Grid}">
						<Setter Property="Background">
							<Setter.Value>
								<LinearGradientBrush EndPoint="0.457,0.296" StartPoint="0.459,1.296">
									<GradientStop Color="#FFCBCBCB"/>
									<GradientStop Color="White" Offset="1"/>
								</LinearGradientBrush>
							</Setter.Value>
						</Setter>
					</Style>
				</Setter.Value>
			</Setter>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type chartingToolkit:Chart}">
						<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="10">
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="*"/>
								</Grid.RowDefinitions>
								<visualizationToolkit:Title Style="{TemplateBinding TitleStyle}" Content="{TemplateBinding Title}" Margin="0,10,0,5"/>
								<Grid Margin="0" Grid.Row="1">
									<Grid.RowDefinitions>
										<RowDefinition Height="*"/>
										<RowDefinition Height="Auto"/>
									</Grid.RowDefinitions>
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="*"/>
									</Grid.ColumnDefinitions>
									<System_Windows_Controls_DataVisualization_Charting_Primitives:EdgePanel x:Name="ChartArea" Style="{TemplateBinding ChartAreaStyle}" Margin="0,0,0,5">
										<Grid Style="{TemplateBinding PlotAreaStyle}" Panel.ZIndex="-1"/>
										<Border Panel.ZIndex="10" BorderBrush="#FF919191" BorderThickness="1"/>
									</System_Windows_Controls_DataVisualization_Charting_Primitives:EdgePanel>
									<visualizationToolkit:Legend x:Name="Legend" Style="{TemplateBinding LegendStyle}" Grid.Column="0" Title="{TemplateBinding LegendTitle}" Grid.Row="1" Margin="0" VerticalAlignment="Stretch" Template="{DynamicResource ColorPieLegendStyle}" Visibility="Collapsed"/>
								</Grid>
							</Grid>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<ControlTemplate x:Key="ColorPieLegendStyle" TargetType="{x:Type visualizationToolkit:Legend}">
			<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="2" Visibility="Collapsed">
				<Grid>
					<Grid.RowDefinitions>
						<RowDefinition Height="Auto"/>
						<RowDefinition/>
					</Grid.RowDefinitions>
					<visualizationToolkit:Title Style="{TemplateBinding TitleStyle}" Content="{TemplateBinding Title}" Grid.Row="0"/>
					<ScrollViewer BorderThickness="0" IsTabStop="False" Padding="0" Grid.Row="1" VerticalScrollBarVisibility="Auto">
						<StackPanel x:Name="LegendItemsArea" Margin="10,0,10,10" Grid.Column="1"/>
					</ScrollViewer>
				</Grid>
			</Border>
		</ControlTemplate>		
		<Style x:Key="DeckStatLegendItemStyle" TargetType="chartingToolkit:LegendItem">
	        <Setter Property="IsTabStop" Value="False"/>
	        <Setter Property="Template">
	            <Setter.Value>
	                <ControlTemplate TargetType="chartingToolkit:LegendItem">
	                    <StackPanel Orientation="Horizontal">
	                        <Rectangle Width="8" Height="8" Fill="{Binding Background}" Stroke="{Binding BorderBrush}" StrokeThickness="1" Margin="0,0,3,0"/>	                        
							<ContentControl Content="{TemplateBinding Content}"/>
							<TextBlock Margin="3,0,0,0">(</TextBlock>
							<ContentControl Content="{Binding DataContext.Value}" />
							<TextBlock>)</TextBlock>
	                    </StackPanel>
	                </ControlTemplate>
	            </Setter.Value>
	        </Setter>
	    </Style>
</ResourceDictionary>